<?php

class Action_Admin_UpdateDB extends RL_Handler
{
	
	public function process ()
	{
		// HACK : 2008-02-12 : lucky
		// простая аутентификация.
		if (!isset($_GET['digest']) || $_GET['digest'] !== $this->rh->project_key) return; // 404
		
		$aa = $this->module->aa;
		$this->ctx->mm->setAclAssistant($aa);
		
		// добавим режим вступления во все сообщества
		$rs = $this->ctx->store->find('select objects where objects.type = "fcommunity"');
		while ($obj = $rs->next()) {
			$config = unserialize($obj->data['config']);
			$config['join_mode'] = "free";
			$obj->data['config'] = serialize($config);
			$obj->save();
		}
		
		$view = 'Ok';

		$this->rh->response->setContent($view);
	} // end of function execute

}

